<body>
  <script>
    function jsonp(url, callback) {
      var name = 'jsonp' + Math.random().toString().replace(/\D/g, '');
      window[name] = callback;
      var script = document.createElement('script');
      var attr = document.createAttribute('src');
      attr.value = url + '?callback=' + name;
      script.setAttributeNode(attr);
      document.body.appendChild(script);
    };
    jsonp('http://localhost:8082/test.php', function (data) {
      console.log(data);
    });
  </script>
  <a href="../首页/page10.html">
    <h2>返回上一页面</h2>
  </a>
</body>